package git.bankview.wl.common;

import java.util.*;
import java.text.*;
import java.sql.*;

import laya.semi.process.*;

import git.bankview.sl.db.*;

import org.apache.log4j.Logger;

public class RealFieldListToPercentsDecorator
	implements IGenericClassActivity
{
	private static Logger log = Logger.getLogger(RealFieldListToPercentsDecorator.class);

	public void execute(IProcessContext oCtx)
		throws Exception
	{
		String[] vPairs = oCtx.getActivityParameter().split(":");
		String oResultField = vPairs[0];
		List oResultList = (List)oCtx.getField(oResultField);
		
		for (int j = 0; j < oResultList.size(); ++j)
		{
			Map oRec = (Map)oResultList.get(j);
			for (int i = 1; i < vPairs.length; ++i)
			{
				String[] vDestSrc = vPairs[i].split("=");
				Number oSrc = (Number)oRec.get(vDestSrc[1]);
				oRec.put(vDestSrc[0], new Double(oSrc.doubleValue() * 100.0));
			}
		}
	}
}
